package com.qfjy.homework.xuhuiqianpai;

import java.math.BigDecimal;

/**
 * @author: xh
 * @date: 2022/11/10 19:39
 * @version: 1.0
 */
public class CustomPayTest {

    public static void main(String[] args) {

        System.out.println("========新用户==========");
        Payable payable = new NewCustomActualPayment();
        ActualPayment actualPayment = new ActualPayment(payable);
        BigDecimal pay = actualPayment.pay(new BigDecimal(100));
        System.out.println("实付金额为：" + pay);

        System.out.println("========老用户==========");
        payable = new OldCustomActualPayment();
        actualPayment = new ActualPayment(payable);
        pay = actualPayment.pay(new BigDecimal(100));
        System.out.println("实付金额为：" + pay);

        System.out.println("========VIP用户==========");
        payable = new VIPCustomActualPayment();
        actualPayment = new ActualPayment(payable);
        pay = actualPayment.pay(new BigDecimal(100));
        System.out.println("实付金额为：" + pay);

        System.out.println("========MVP用户==========");
        payable = new MVPCustomActualPayment();
        actualPayment = new ActualPayment(payable);
        pay = actualPayment.pay(new BigDecimal(100));
        System.out.println("实付金额为：" + pay);
    }
}
